let m = "changeName";
module.exports = {
    namespace: 'cat',
    state: {
        name: "wangwu",
        age: 17
    },
    effects: {
        *"changeNameSync"({ payload }, { call, put }) {
            let deley = (name) => {
                return new Promise((r, s) => {
                    setTimeout(() => {
                        r(name);
                    }, 2000);
                })
            }
            let res= yield call(deley, '王二')
            yield put({
                type: "changeName",
                payload:res
            })
        },
    },
    reducers: {
        [m](state, action) {
            console.log(action);
            return {
                ...state,
                name: action.payload
            };
        },
    }
}